package cnpm.entity;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;

@Entity
public class Contract implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	@Id
	@Column(name = "ContractID")
	private String contractID;
	
	@Column(name = "ContractType")
	private String contractType;
	
	@Column(name = "ContractName")
	private String contractName;
	
	@Column(name = "RegDate")
	private String regDate;
	
	@Column(name = "StartDate")
	private String startDate;
	
	@Column(name = "EndDate")
	private String endDate;
	
	@Column(name = "Salary")
	private int salary;
	
	@Column(name = "UpdateDate")
	private String updateDate;
	
	@Column(name = "CreateDate")
	private String createDate;
	
	@Column(name = "UserUpdate")
	private String userUpdate;
	
	@Column(name = "UserCreate")
	private String userCreate;
	
	@ManyToOne(cascade = CascadeType.MERGE, fetch = FetchType.EAGER)
	private Employee empContract;
	
	public Contract(){}

	public String getContractID() {
		return contractID;
	}

	public void setContractID(String contractID) {
		this.contractID = contractID;
	}

	public String getContractType() {
		return contractType;
	}

	public void setContractType(String contractType) {
		this.contractType = contractType;
	}

	public String getRegDate() {
		return regDate;
	}

	public void setRegDate(String regDate) {
		this.regDate = regDate;
	}

	public String getStartDate() {
		return startDate;
	}

	public void setStartDate(String startDate) {
		this.startDate = startDate;
	}

	public String getEndDate() {
		return endDate;
	}

	public void setEndDate(String endDate) {
		this.endDate = endDate;
	}

	public int getSalary() {
		return salary;
	}

	public void setSalary(int salary) {
		this.salary = salary;
	}

	public Employee getEmpContract() {
		return empContract;
	}

	public void setEmpContract(Employee empContract) {
		this.empContract = empContract;
	}

	public String getUpdateDate() {
		return updateDate;
	}

	public void setUpdateDate(String updateDate) {
		this.updateDate = updateDate;
	}

	public String getCreateDate() {
		return createDate;
	}

	public void setCreateDate(String createDate) {
		this.createDate = createDate;
	}

	public String getUserUpdate() {
		return userUpdate;
	}

	public void setUserUpdate(String userUpdate) {
		this.userUpdate = userUpdate;
	}

	public String getUserCreate() {
		return userCreate;
	}

	public void setUserCreate(String userCreate) {
		this.userCreate = userCreate;
	}

	public String getContractName() {
		return contractName;
	}

	public void setContractName(String contractName) {
		this.contractName = contractName;
	}

	@Override
	public String toString() {
		return "Contract [contractID=" + contractID + ", contractType="
				+ contractType + ", regDate=" + regDate + ", startDate="
				+ startDate + ", endDate=" + endDate + ", salary=" + salary
				+ "]";
	}
	
}
